home *** CD-ROM | disk | FTP | other *** search
- //=========================================================
- //
- // save.c
- //
- // void saveto(char *xfile, int header)
- //
- // Save the current message in the file, with or without headers.
- //
- //=========================================================
-
- // $Id: save.c,v 1.2 1994/02/08 23:33:54 gbj Exp user $
-
- /*
- $Log: save.c,v $
- * Revision 1.2 1994/02/08 23:33:54 gbj
- * First public release.
- *
- * Revision 1.1 1994/02/08 03:16:14 gbj
- * Initial revision
- *
- */
-
- #include "mailer.h"
- #include "utils.h"
-
- static char buf[4096], *bp;
-
- void saveto(char *xfile, int header)
- {
- int res;
- char tfile[128];
-
- if (xfile == NULL)
- strcpy(tfile, "mbox.txt");
- else if (*xfile == '\0')
- strcpy(tfile, "mbox.txt");
- else
- strcpy(tfile, xfile);
-
- res=tmp_msg(cmsg, "post.$$$", FALSE, TRUE);
- if (res)
- {
- fprintf(stderr, "saveto: Unable to extract message %d\n", cmsg);
- return;
- }
-
- if (header)
- res=fcopy("post.$$$", tfile, TRUE);
- else
- res=fcopy("post.$$$", tfile, FALSE);
- if (res)
- {
- if (res != -1)
- fprintf(stderr, "saveto: Couldn't copy %s to %s\n",
- "post.$$$", tfile);
- }
- remove("post.$$$");
- return;
- }
-